﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SqlServices
{
    /// <summary>
    /// 获取连接字符串的类为Internal  可以避免外界对于数据库的破坏
    /// </summary>
    internal class GetConnStr
    {
        private static string ConnStr = string.Empty;

        //空构造函数
        public GetConnStr()
        {

        }
        /// <summary>
        /// 该方法会返回唯一的连接字符串
        /// </summary>
        /// <returns></returns>
        public static string GetConn()
        {
            if (string.IsNullOrEmpty(ConnStr))
            {
                ConnStr = System.Configuration.ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString;
            }
            return ConnStr;
        }


    }
}
